home *** CD-ROM | disk | FTP | other *** search
- Path: news.mira.net.au!news
- From: davidw@werple.net.au (David White)
- Newsgroups: comp.lang.c++
- Subject: Re: Is this a memory leak?
- Date: 5 Apr 1996 21:19:58 +1000
- Organization: Werple Internet, Melbourne
- Message-ID: <4k2vku$s82@werple.net.au>
- References: <4jv214$gv7@insosf1.netins.net> <4k02v5$tu7@grimsel.zurich.ibm.com>
- NNTP-Posting-Host: werplez.mira.net.au
-
- wgk@zurich.ibm.com (Keith Whittingham) writes:
-
-
- >The dto, ~TopClass, is a going to try and free some memory at the address
- >0x000 but, by a quirk of implmentation, will probably not blow up (as a
- >simple call to free(0) would). Instead the compiler probably generates
- >code to check that the object address is 0, it so there is no deallocation
- >of the memory.
-
- The use of 0 as a pointer is not the address 0x000. It is a null pointer
- as defined by the language. Implementations are not even required to use a
- bit pattern of all zeroes as a null pointer. They can use any value they
- like, as long as it will not also be used as a real address. Furthermore,
- rather than being a quirk of implementation, the language guarantees that
- deleting a null pointer will do nothing.
-
- David White
- davidw@werple.mira.net.au
-